This directory contains sample applications to demonstrate the usage of the 
Oracle XML beans. Currently, the Oracle XML beans toolset contains the following XML beans:
DOMBuilder
DBAccess
XMLDBAccess
XMLDiff
XMLCompress
XSDValidator
XMLCompress
XSLTransformer

The following are the sample Java files in this directory:

        AsyncTransformSample - A sample nonvisual application using 
                      XSLTransformer bean and DOMBuilder bean.
                      It applies XSLT stylesheet specified in doc.xsl 
                      on all *.xml files from the current directory.   
                      The results are in the files with extention .log. 
 
        XMLDBAccessSample - This is a non-GUI sample for the XMLDBAccess bean.
                      It demonstrates the way the XMLDBAccess bean APIs can be
                      used to store and retrive the XML documents inside the 
                      database using XMLType tables.
        
        XMLDiffSample - Sample visual application that uses XMLDiff bean to 
                      diff two XML files and generate an XSL stylesheet. This
                      stylesheet can be used to transform input XML file1 into
                      input XML file2.

        compviewer   - Sample visual application that uses XMLCompress bean 
                      to compress an XML file or XML data from the database
                      obtained through SQL query or from a CLOB or an 
                      XMLType Table. The application also lets to uncompress
                      the compressed stream and view the resulting DOM tree.

        XSDValidatorSample - Sample application for XSDValidator bean. Takes
                      two arguments as input, an xml-file and a schema-file. 
                      The error occuring during validation, including line 
                      numbers, are displayed.
                                           

Installing the XDK Java beans
================================

The beans require the version of JDK 1.4 as minimum.

1) You need to download and install the following component that is used
   by the Oracle XML beans:

   - Oracle JDBC Driver for thin client:
       Make sure that the version of the JDBC driver is the same or higher
       than the Oracle database you want to access.

   After installing this component, include the ojdbc14.jar in your classpath.


2) Change the JDKPATH in the Makefile to point to your JDK path.

3) Use "make" to generate .class files.

4) Run the sample programs using commands:
   gmake sample1
   gmake sample2 
   gmake sample3 
   gmake sample4
   gmake sample5
   

Notes:

   Sample1 is a non-gui demo for the asynchronous DOMBuilder and 
   XSLTransformer beans. It applies XSLT stylesheet (doc.xsl) on all *.xml 
   files in the current directory. The output is stored in the files with 
   extention .log.

   Sample2 is a demo for XMLDBAccess bean. It uses the XMLType objects to store
   XML documents inside the database. To use XMLType an Oracle 9i or higher 
   installation is necessary along with the xdb.jar. Sample2 will run 
   XMLDBAccessSample using the values for HOSTNAME, PORT, SID, USERID, 
   PASSWORD as defined in the Makefile.  These should be modified as required.
   The booklist.xml file is used to insert data into the database. The output 
   is copied to xmldbaccess.log.

   Sample3 is a demo for XMLDiff bean. It invokes a GUI which allows you to 
   choose the input data files from the 'File' menu using 'Compare XML Files' 
   item. The XSLT generated can be applied on input XML file1 using 'Transform'
   menu. Resulting XML file (which will be the same as input file2) can be 
   saved using 'Save As' item under 'File' menu. By default the 2 XML files
   XMLDiffData1.txt and XMLDiffData2.txt are compared and the output XSLT is 
   stored as XMLDiffSample.xsl.
   Note: If the input XML files have a DTD which accesses a URL outside the 
   firewall, then please modify the XMLDiffSample.java to include the proxy 
   server settings before the setFiles() call:
   e.g.
    /* Set proxy to access dtd through firewall */
    Properties p = System.getProperties();
    p.put("proxyHost", "www.proxyservername.com");
    p.put("proxyPort", "80");
    p.put("proxySet", "true");
    You will also have to import java.util.*;

   Sample4 is a demo for XMLCompress bean. It invokes a GUI which lets the 
   user compress/uncompress XML files and data obtained from the Database. The
   loading options lets the user to get the data either from a file system or 
   a database. This application does not support loading/saving compressed data
   from the database. The compression factor indicates a rough estimate by 
   which the XML data is reduced.

   Sample5 is a demo for the XSDValidator bean. Its takes as default the
   purchaseorder.xml data file and the purchaseorder.xsd schema file.  The 
   output will display the validation errors.


